-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow inset-text to take a block #1078
Conversation
1a97cae
to
2f046dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think allowing a generic block is a good idea. It doesn't allow for consistent styling, and we'd have to depend on every place that uses the component to test how it renders and that it's accessible. If we're going to that we might as well create a new component in the application so at least all of the code for the component and its tests are in the same place.
I think it would be better to limit what the block will accept, e.g. a title and a list of items, and then add some tests around that.
We do have other components that accept a block like this, and the guidance around that is that the contents should be styled separately from the component, ie. the component takes no responsibility for what it is passed. We should at least document that in this component. |
@andysellick Do you have an example? |
There's a few, although they don't seem to document what I was talking about 😞
|
Happy to add a clarifying note. |
7ad89cb
to
818b391
Compare
818b391
to
e3c7ad7
Compare
e3c7ad7
to
04a1a47
Compare
Can now pass an arbitrary block to the inset-text component to have content rendered inset. If both 'text' and a block are provided, 'text' takes precedence (mutually exclusive). This is a compromise solution, rather than copying the inset-prompt component from content-publisher (for use in collections-publisher), for the reason that under current GOV.UK architecture the component CSS would be added to the stylesheets for our end users (not just the users using the publishing app). See: #1077 Once merged, we will use this latest inset-text component and manually recreate what the inset-prompt component looks like by passing components to the inset-text component as a block. Trello: https://trello.com/c/TcBpLRuC/48-add-inset-prompt-component-to-govukpublishingcomponents
04a1a47
to
ec86bca
Compare
* **BREAKING:** Remove the inverse flag for contents list component ([PR #1090](#1090)) * Will stop any inverse flags on the contents list component from working * Set all branded links to correct focus colour ([PR #1088](#1088)) * Fix components focus state spacing ([PR #1054](#1054)) * Allow inset-text to take a block ([PR #1078](#1078))
* **BREAKING:** Remove the inverse flag for contents list component ([PR #1090](#1090)) * Will stop any inverse flags on the contents list component from working * Set all branded links to correct focus colour ([PR #1088](#1088)) * Fix components focus state spacing ([PR #1054](#1054)) * Allow inset-text to take a block ([PR #1078](#1078))
* **BREAKING:** Remove the inverse flag for contents list component ([PR #1090](#1090)) * Will stop any inverse flags on the contents list component from working * Set all branded links to correct focus colour ([PR #1088](#1088)) * Fix components focus state spacing ([PR #1054](#1054)) * Allow inset-text to take a block ([PR #1078](#1078))
What
Can now pass an arbitrary block to the inset-text component to
have content rendered inset. If both 'text' and a block are
provided, 'text' takes precedence (mutually exclusive).
Why
This is a compromise solution, rather than copying the inset-prompt
component from content-publisher (for use in collections-publisher),
for the reason that under current GOV.UK architecture the component
CSS would be added to the stylesheets for our end users (not just
the users using the publishing app). See:
#1077
Once merged, we will use this latest inset-text component and
manually recreate what the inset-prompt component looks like by
passing components to the inset-text component as a block.
Trello: https://trello.com/c/TcBpLRuC/48-add-inset-prompt-component-to-govukpublishingcomponents
Visual Changes
View Changes
https://govuk-publishing-compo-pr-1078.herokuapp.com/